/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 7/8/11
 * Time: 10:45 PM
 * To change this template use File | Settings | File Templates.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.FileReader;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.Arrays;

public class Hockey extends Thread {

    public Hockey() {
        this.input = new BufferedReader(new InputStreamReader(System.in));
        this.output = new PrintWriter(System.out);
        this.setPriority(Thread.MAX_PRIORITY);
    }

    public void run() {
        try {
            int n = nextInt();
            String patterns[] = new String[n];
            for (int i = 0; i < n; ++i){
                patterns[i] = nextToken().toLowerCase();
            }
            String initial = nextToken();
            String lowerInitial = initial.toLowerCase();
            char letter = nextToken().charAt(0);
            char lexicalReplacing = (letter == 'a') ? 'b' : 'a';
            boolean []badPositions = new boolean [initial.length()];

            for (int i = 0; i < lowerInitial.length(); ++i){
                for (String current : patterns){
                    if (lowerInitial.substring(i).startsWith(current)){
                        for (int j = 0; j < current.length(); ++j){
                            badPositions[j + i] = true;
                        }
                    }
                }
            }
            for (int i = 0; i < badPositions.length; ++i){
                 if (badPositions[i]) {
                    if (lowerInitial.charAt(i) == letter) {
                        output.print(Character.isLowerCase(initial.charAt(i)) ? lexicalReplacing :
                                Character.toUpperCase(lexicalReplacing));
                    } else {
                        output.print(Character.isLowerCase(initial.charAt(i)) ? letter :
                                Character.toUpperCase(letter));
                    }
                } else {
                    output.print(initial.charAt(i));
                }
            }
            output.flush();
            output.close();

            output.flush();
            output.close();

        } catch (Throwable e) {
            System.err.println(e.getMessage());
            System.err.println(Arrays.deepToString(e.getStackTrace()));
        }
    }


    public static void main(String[] args) {
        new Hockey().start();
    }

    private String nextToken() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }


    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}
